package calendar;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class CalendarDemo {
    public static void main(String[] args) {
        Calendar instance = Calendar.getInstance();
        System.out.println(instance);
        instance.add(Calendar.DATE,100);
        Date time = instance.getTime();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String format = simpleDateFormat.format(time);
        System.out.println(format);
        Calendar instance1 = Calendar.getInstance();
        int i = instance1.get(Calendar.DATE);
        System.out.println(i);
        int year = instance1.get(Calendar.YEAR);
        int month = instance1.get(Calendar.MONTH);
        int day = instance1.get(Calendar.DAY_OF_MONTH);
        int hour = instance1.get(Calendar.HOUR_OF_DAY);
        int min= instance1.get(Calendar.MINUTE);
        int second = instance1.get(Calendar.SECOND);
        int mileSecond = instance1.get(Calendar.MILLISECOND);

    }
}
